from kuai.analysis.diffmol import digest_compare
from kuai.analysis.diffmol import filter_compare

file = open("compare.log")
output = open("digest.csv", "w")

def filter(inputfile):

    input = open(inputfile)
    output = open("compare_bond.log", "w")
    filter_compare(input, output, "Compare of Bonds")
    input.close()
    output.close()

    input = open(inputfile)
    output = open("compare_angle.log", "w")
    filter_compare(input, output, "Compare of Angles")
    input.close()
    output.close()

    input = open(inputfile)
    output = open("compare_torsion.log", "w")
    filter_compare(input, output, "Compare of Torsion")
    input.close()
    output.close()

if __name__ == "__main__":
    digest_compare(file, output)
    filter("compare.log")
